

void UI_LinePolygon2Options::destroy() {
    PF_SETTINGS->beginGroup("/Draw");
    PF_SETTINGS->writeEntry("/LinePolygon2Number", sbNumber->text());
    PF_SETTINGS->endGroup();
}

void UI_LinePolygon2Options::setAction(PF_ActionInterface* a, bool update) {
    if (a!=NULL && a->rtti()==LX_Define::ActionDrawLinePolygon2) {
        action = (WF_DrawLinePolygon2*)a;

        QString sn;
        if (update) {
            sn = QString("%1").arg(action->getNumber());
        } else {
            PF_SETTINGS->beginGroup("/Draw");
            sn = PF_SETTINGS->readEntry("/LinePolygon2Number", "3");
            PF_SETTINGS->endGroup();
        }
        sbNumber->setValue(sn.toInt());
    } else {
        PF_DEBUG->print(PF_Debug::D_ERROR, 
			"UI_LinePolygon2Options::setAction: wrong action type");
        action = NULL;
    }

}

void UI_LinePolygon2Options::updateNumber(int n) {
    if (action!=NULL) {
        action->setNumber(n);
    }
}
